/**
 * Copyright (c) Enalean, 2017. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

%color-area {
    display: block;
    height: 25px;
    border-radius: 3px;

    @for $i from 1 through length($tlp-swatch-color-names) {
        &.#{nth($tlp-swatch-color-names, $i)} {
            border-color: nth($tlp-swatch-color-primaries, $i);
            background: nth($tlp-swatch-color-primaries, $i);

            &:hover:not(:disabled):not(.disabled):not(:active) {
                border-color: darken(nth($tlp-swatch-color-primaries, $i), 5%);
                background: darken(nth($tlp-swatch-color-primaries, $i), 5%);
            }
        }
    }
}

.project-labels-table-name,
.project-labels-table-is-used {
    width: 50%;
}

.project-labels-table-name-icon {
    margin: 0 5px 0 0;

    @for $i from 1 through length($tlp-swatch-color-names) {
        &.project-labels-table-name-icon-#{nth($tlp-swatch-color-names, $i)} {
            color: nth($tlp-swatch-color-primaries, $i);
        }
    }
}

.project-labels-table-is-used-help {
    cursor: help;
}

.project-label-name-warning {
    display: none;

    &.shown {
        display: block;
    }
}

.project-label-color-selector {
    width: 80px;
}

.project-label-options {
    display: flex;
}

.tlp-form-element.project-label-style {
    margin: 0 0 $tlp-spacing $tlp-double-spacing;
}

.project-label-style-options {
    display: flex;
    align-items: center;
    padding: 8px 0 0;
}

.project-label-style-option-outline {
    margin: 0 0 $tlp-half-spacing $tlp-spacing;
}

.project-label-color-results,
.project-label-color-container {
    span {
        @extend %color-area;
    }
}

.project-label-color-results {
    height: 250px;
}
